﻿using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;

using System.Data.SqlClient;

public partial class DetailUser : System.Web.UI.Page
{
    int toUser;
    int userid;
    //string username;
    //string str;
    protected void Page_Load(object sender, EventArgs e)
    {

        if (Session["uid"] == null)
        {
            Response.Redirect("../GUI/Home.aspx");
        }
        else
        {
            string str = Request.QueryString.Get("dtpr");
            HiddenUserID.Value = str;
            toUser = int.Parse(HiddenUserID.Value);
            string username = Session["uid"].ToString();
            userid = ToolsDT.getUserID(username);      
        }    
    }
    protected void btnAddFriend_Click(object sender, EventArgs e)
    {
        string status = "pending";
        ToolsDT.sendInvite(userid,toUser,status);
        Response.Write(@"<script language='javascript'>alert('Friend request successful.')</script>");       
    }
}
